###
# This software is provided 'as-is', without any express or implied
# warranty.  In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
# 
# 1. The origin of this software must not be misrepresented; you must not
#    claim that you wrote the original software. If you use this software
#    in a product, an acknowledgment in the product documentation would be
#    appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and must not be
#    misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
#
# Note: Some of the libraries GMEngine may link to may have additional
# requirements or restrictions.
#
###

cmake_minimum_required(VERSION 2.8)
 
project(RL)

#---------------------------------------------------------------
set(GAMEOBJECTS_H
	./GameObjects/GameObject.h
	./GameObjects/Player.h
	./GameObjects/Tree.h
)
SOURCE_GROUP("Header Files\\GameObjects" FILES ${GAMEOBJECTS_H})
set(GAMEOBJECTS_S
	./GameObjects/GameObject.cpp
	./GameObjects/Player.cpp
	./GameObjects/Tree.cpp
)
SOURCE_GROUP("Source Files\\GameObjects" FILES ${GAMEOBJECTS_S})
#---------------------------------------------------------------
set(MAPS_H
	./Maps/TerrainType.h
	./Maps/MapCell.h
	./Maps/Weather.h
	./Maps/Forest.h
)
SOURCE_GROUP("Header Files\\Maps" FILES ${MAPS_H})
set(MAPS_S
	./Maps/TerrainType.cpp
	./Maps/MapCell.cpp
	./Maps/Weather.cpp
	./Maps/Forest.cpp
)
SOURCE_GROUP("Source Files\\Maps" FILES ${MAPS_S})
#---------------------------------------------------------------
set(WORLD_H
	./World/World.h
	./World/Grid.h
	./World/Chunk.h
	./World/Cell.h
)
SOURCE_GROUP("Header Files\\World" FILES ${WORLD_H})
set(WORLD_S
	./World/World.cpp
	./World/Grid.cpp
	./World/Chunk.cpp
	./World/Cell.cpp
)
SOURCE_GROUP("Source Files\\World" FILES ${WORLD_S})
#---------------------------------------------------------------
set(MANAGERS_H
	./Managers/GameManager.h
	./Managers/InputManager.h
)
SOURCE_GROUP("Header Files\\Managers" FILES ${MANAGERS_H})
set(MANAGERS_S
	./Managers/GameManager.cpp
	./Managers/InputManager.cpp
)
SOURCE_GROUP("Source Files\\Managers" FILES ${MANAGERS_S})
#---------------------------------------------------------------
set(MATH_H
	./Math/Vec2i.h
	./Math/Vec3f.h
)
SOURCE_GROUP("Header Files\\Math" FILES ${MATH_H})
set(MATH_S
	./Math/Vec2i.cpp
	./Math/Vec3f.cpp
)
SOURCE_GROUP("Source Files\\Math" FILES ${MATH_S})
#---------------------------------------------------------------
set(RENDERER_H
	./Renderer/DeferredRenderer.h
)
SOURCE_GROUP("Header Files\\Renderer" FILES ${RENDERER_H})
set(RENDERER_S
	./Renderer/DeferredRenderer.cpp
)
SOURCE_GROUP("Source Files\\Renderer" FILES ${RENDERER_S})
#---------------------------------------------------------------
set(WORLD2_H
	./World2/TheWorld.h
	./World2/Region.h
	./World2/Area.h
)
SOURCE_GROUP("Header Files\\World2" FILES ${WORLD2_H})
set(WORLD2_S
	./World2/TheWorld.cpp
	./World2/Region.cpp
	./World2/Area.cpp
)
SOURCE_GROUP("Source Files\\World2" FILES ${WORLD2_S})
#---------------------------------------------------------------
set(WORLD2_WORLD_H
	./World2/World/WorldCell.h
	./World2/World/WorldSpace.h
)
SOURCE_GROUP("Header Files\\World2\\World" FILES ${WORLD2_WORLD_H})
set(WORLD2_WORLD_S
	./World2/World/WorldCell.cpp
	./World2/World/WorldSpace.cpp
)
SOURCE_GROUP("Source Files\\World2\\World" FILES ${WORLD2_WORLD_S})
#---------------------------------------------------------------
set(WORLD2_REGION_H
	./World2/Region/RegionCell.h
	./World2/Region/RegionObject.h
	./World2/Region/RegionSound.h
	./World2/Region/RegionWeather.h
)
SOURCE_GROUP("Header Files\\World2\\Region" FILES ${WORLD2_REGION_H})
set(WORLD2_REGION_S
	./World2/Region/RegionCell.cpp
	./World2/Region/RegionObject.cpp
	./World2/Region/RegionSound.cpp
	./World2/Region/RegionWeather.cpp
)
SOURCE_GROUP("Source Files\\World2\\Region" FILES ${WORLD2_REGION_S})
#---------------------------------------------------------------
set(WORLD2_AREA_H
	./World2/Area/AreaCell.h
)
SOURCE_GROUP("Header Files\\World2\\Area" FILES ${WORLD2_AREA_H})
set(WORLD2_AREA_S
	./World2/Area/AreaCell.cpp
)
SOURCE_GROUP("Source Files\\World2\\Area" FILES ${WORLD2_AREA_S})
#---------------------------------------------------------------
set(HDRS
	${GAMEOBJECTS_H}
	${MAPS_H}
	${MANAGERS_H}
	${MATH_H}
	${RENDERER_H}
	${WORLD2_H}
	${WORLD2_WORLD_H}
	${WORLD2_REGION_H}
	${WORLD2_AREA_H}
)

set(SRCS
	${GAMEOBJECTS_S}
	${MAPS_S}
	${MANAGERS_S}
	${MATH_S}
	${RENDERER_S}
	${WORLD2_S}
	${WORLD2_WORLD_S}
	${WORLD2_REGION_S}
	${WORLD2_AREA_S}
	main.cpp
)

find_package(Libtcod REQUIRED)
add_executable(RL ${HDRS} ${SRCS})
set_target_properties(RL PROPERTIES DEBUG_POSTFIX -debug)
set_target_properties(RL PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(RL
	debug ${LIBTCOD_DEBUG} optimized ${LIBTCOD_RELEASE}
	debug ${LIBTCOD_GUI_DEBUG} optimized ${LIBTCOD_GUI_RELEASE}
)
